﻿
Ext.define('workflow.views.mainform', {
    extend: 'Ext.form.Panel',
    alias: 'widget.mainform',
    border: '',
    id: 'mainform',
    //require: ['MyApp.stores.sourceStore'],
    initComponent: function () {
        var me = this;
        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'panel',
                    height: 265,
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '发现',
                    items: [
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    id: 'txt_title_1',
                                    name: 'yhjt',
                                    fieldLabel: '　事故隐患简题',
                                    columnWidth:.7,
                                    labelWidth: 90
                                },
                                {
                                    xtype: 'combobox',
                                    id: 'com_source_@101',
                                    displayField: 'ID',
                                    disabled:true,
                                    name: 'yhly',
                                    columnWidth:.3,
                                    fieldLabel: '　隐患来源',
                                    //valueField:'ID',
                                    store: Ext.create('Ext.data.Store', {
                                                                       autoLoad: true,
                                                                      fields: [{ type:'int', name: 'ID' },
                                                                              { type:'int', name: 'Source' }],
                                                                        proxy: {
                                                                            type: 'ajax',
                                                                            api: {
                                                                                    read: '../../../workflow/workflow_ajax.aspx?action=read'
                                                                               },
                                                                            reader: {
                                                                                type: 'json',
                                                                                successProperty: 'success',
                                                                                root: 'data',
                                                                                messageProperty: 'message'
                                                                            }
                                                                       }
                                                                    }),
                                    labelWidth: 65,
                                    queryMode: 'local'
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    id: 'txt_no_1',
                                    name: 'yhbh',
                                    readOnly: true,
                                    fieldLabel: '　隐患编号',
                                    labelWidth: 65
                                }/*,
                                {
                                    xtype: 'combobox',
                                    id: 'com_place_1',
                                    name: 'yhdw',
                                    fieldLabel: '　隐患所在单位',
                                    labelWidth: 90
                                },
                                {
                                    xtype: 'combobox',
                                    id: 'com_classify_1',
                                    name: 'yhzyfl',
                                    fieldLabel: '　专业分类',
                                    labelWidth: 65
                                }*/
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    id: 'txt_finder_1',
                                    itemId: '',
                                    name: 'yhfxr',
                                    fieldLabel: '　隐患发现人',
                                    labelStyle: '',
                                    labelWidth: 80
                                }/*,
                                {
                                    xtype: 'combobox',
                                    id: 'com_findunit_1',
                                    name: 'fxrdw',
                                    fieldLabel: '　发现人单位',
                                    labelWidth: 80
                                }*/,
                                {
                                    xtype: 'datefield',
                                    id: 'date_find_1',
                                    invalidText: '日期格式不正确（年-月-日）',
                                    name: 'fxrq',
                                    fieldLabel: '　发现日期',
                                    labelWidth: 65,
                                    format: 'Y-m-d',
                                    maxText: '日期必须小于{maxValue}',
                                    minText: '日期必须大于{minValue}',
                                    showToday: false
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 118,
                            padding: 5,
                            anchor: '100%',
                            items: [
                                {
                                    xtype: 'textareafield',
                                    height: 104,
                                    id: 'area_content_1',
                                    name: 'fxyhnr',
                                    fieldLabel: '　事故隐患内容',
                                    labelWidth: 90
                                }
                            ]
                        }
                    ]
                }
            ]
        });

        me.callParent(arguments);
    }
});